home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / utilities / easyproc2.lha / EasyProcess / hc / debug.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-05  |  721 b   |  39 lines

  1. #include "hc.h"
  2.  
  3. #define DOSBase ADOSBase
  4. static struct Library *ADOSBase = NULL;
  5. static BPTR DebugOut = NULL;
  6.  
  7.  
  8. void Outer (struct DebugInfo *dbi)
  9. {
  10.     ULONG result;
  11.  
  12.     dbi->OutSig = AllocSignal (-1);
  13.  
  14.     ADOSBase = OpenLibrary ("dos.library", 0L);
  15.     if (ADOSBase)
  16.     {
  17.         DebugOut = Open ("con:420/0/220/200/HC_DebugOut", ACTION_FINDUPDATE);
  18.         if (DebugOut == NULL)
  19.         {
  20.             goto quit;
  21.         }
  22.  
  23.         do
  24.         {
  25.             result = Wait (1L << dbi->OutSig | KILL_PROCESS_FLAG);
  26.             if (result & (1L << dbi->OutSig))
  27.             {
  28.                 Write (DebugOut, dbi->Msg, strlen (dbi->Msg));
  29.                 Signal (dbi->HCProc, 1L << dbi->HCSig);
  30.             }
  31.         }
  32.         while (!(result & KILL_PROCESS_FLAG));
  33.     }
  34.  
  35. quit:
  36.     if (DebugOut)    Close (DebugOut);
  37.     if (ADOSBase)    CloseLibrary (ADOSBase);
  38. }
  39.